package com.hw.protocol.tool.decode.hw;

import com.hw.protocol.tool.model.entity.hw.RegulatorBox;
import com.hw.protocol.tool.model.entity.hw.RegulatorBoxHis;

/**
 * @author : lihy
 * @date : 2023/10/19 10:58
 * description: 智能调压箱历史数据解码器
 */
public class RegulatorBoxHisDecode extends RegulatorBoxDecode implements IHisDecode {

    private RegulatorBoxHis his;

    public RegulatorBoxHisDecode(RegulatorBox box, byte[] data) {
        super(box, data);
        this.his = (RegulatorBoxHis)box;
    }

    @Override
    public boolean buildObject() {
        his.setTime(getTime(dataBuf));
        return super.buildObject();
    }

    /**
     * 历史数据需要crc校验
     */
    @Override
    boolean crc() {
        return true;
    }
}
